package com.klikmee.sms.core.base.postman;

import com.klikmee.sms.core.commons.exceptions.ErrorInfo;
import com.klikmee.sms.core.commons.exceptions.InternalException;
import com.klikmee.sms.core.commons.exceptions.ErrorInfo.ErrorType;

/**
 * Thrown when service URL used to delivery messages or status reports is invalid.
 * @author makcro
 *
 */
public class InvalidServiceUrlException extends InternalException {

	/**
	 * 
	 */
	private static final long	serialVersionUID	= 1L;

	public InvalidServiceUrlException() {
		super();
	}

	public InvalidServiceUrlException(String message, Throwable cause) {
		super( message, cause );
	}

	public InvalidServiceUrlException(String message) {
		super( message );
	}
	
	public static InvalidServiceUrlException create(String message, String context) {
		InvalidServiceUrlException exception = new InvalidServiceUrlException( message );
		ErrorInfo errorInfo = exception.addInfo();
		
		errorInfo.setContextId( context );
		errorInfo.setErrorType( ErrorType.INTERNAL );
		errorInfo.setErrorId( "Invalid service URL" );
		
		return exception;
	}
	

}
